shortcut to calculate the number of factors